<?php
class Hvn_BlockController extends Clu_Controller_Action_Mini
{
	
	public function init()
	{
		//require_once (APP_PATH.'/modules/place/Model/Place.php');
		//require_once (APP_PATH.'/modules/place/Model/City.php');
		//require_once (APP_PATH.'/modules/place/Form/PlaceSearch.php');
		//require_once (APP_PATH.'/modules/article/Model/Article.php');
		//require_once (APP_PATH.'/modules/event/Model/Event.php');
		//require_once (APP_PATH.'/modules/category/Model/Category.php');
		$this->mPlace = new place_Model_Place();
		$this->mArticle = new article_Model_Service();
		parent::init();
	}
	
	public function simpleSearchAction()
    {
    	$regionId = $this->miniRequest['regionId'];
		$boxWeight = $this->miniRequest['boxWeight'];
		$form = new place_Form_PlaceSearch();
    	$form->cluBuild(array('action' => 'search', 'view' => $this->view, 'cluSearchMode' => 'simpleSearch'));
        $this->view->form = $form;
    	/*
		//todo: just sample to test layout. to be removed
		$placeSimpleSearchRequest = array(
				'module' => 'place',
				'controller' => 'block',
				'action' => 'simpleSearch',
				'regionId' => 8,
				'boxWeight' => 1,
		);
		$this->addMiniAction($placeSimpleSearchRequest);
		$eventSimpleSearchRequest = array(
				'module' => 'event',
				'controller' => 'block',
				'action' => 'simpleSearch',
				'regionId' => 8,
				'boxWeight' => 2,
		);
		$this->addMiniAction($eventSimpleSearchRequest);
		
		$tourSimpleSearchRequest = array(
				'module' => 'tour',
				'controller' => 'block',
				'action' => 'simpleSearch',
				'regionId' => 8,
				'boxWeight' => 3,
		);
		$this->addMiniAction($tourSimpleSearchRequest);
<<<<<<< .mine
//	die('anh');
		
=======
>>>>>>> .r604
		$this->renderToHolder('index/mini_search.phtml', false, null, $regionId, $boxWeight);
		*/
		$this->renderToHolder('hvn/home-search.phtml', false, null, $regionId, $boxWeight);
    }
    
    public function mapPlaceAction()
	{
		$placeId = $this->miniRequest['placeId'];
		$regionId = $this->miniRequest['regionId'];
		$boxWeight = $this->miniRequest['boxWeight'];
		$category_rtype = $this->miniRequest['category_rtype'];
		$this->view->placeId = $placeId;
//		if($category_rtype == 90)
		{
			$this->renderToHolder('block/mapvietnam.phtml', true, null, $regionId, $boxWeight);
		}
	}
	
	public function mapVietnamAction()
	{
		$regionId = $this->miniRequest['regionId'];
		$boxWeight = $this->miniRequest['boxWeight'];
		$this->renderToHolder('block/mapvietnam.phtml', true, null, $regionId, $boxWeight);
		//$this->renderToHolder('block/social_bookmarking.phtml', true, 5, 2);
	}
	
	public function onlineSupportAction()
	{
		//online support
		$regionId = $this->miniRequest['regionId'];
		$boxWeight = $this->miniRequest['boxWeight'];
		///TODO
		$this->renderToHolder('block/onlineSupport.phtml', true, null, $regionId, $boxWeight);
	}
	
	public function mainMenuAction()
	{
		$regionId = $this->miniRequest['regionId'];
		$boxWeight = $this->miniRequest['boxWeight'];
		$this->renderToHolder('block/mainMenu.phtml', false, null, $regionId, $boxWeight);
	}
}
?>